<template>
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="formDisabled">
      <a-form :form="form" slot="detail">
        <a-row>
          <a-col :span="12">
            <a-form-item label="所属项目" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['productBelongValue',{initialValue:this.record.productBelongValue}]" id="productBelongValue" placeholder="请输入所属项目" disabled></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="物料大类" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['applyId',{initialValue:this.record.codeTypeName}]" id="applyId" placeholder="请输入物料大类" disabled></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="物料子类" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['productId',{initialValue:this.record.codeSubtypeName}]" id="productId" placeholder="请输入物料子类" disabled></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="物料名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['productNameValue',{initialValue:this.record.productNameValue}]" placeholder="请输入物料名称" disabled></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="制造厂商" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['factory',{initialValue:this.record.factoryNameValue}]" id="factory" placeholder="请输入制造厂商" disabled></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="规格型号" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['productTypeName',{initialValue:this.record.productTypeName}]" id="productTypeName" placeholder="请输入规格型号" disabled></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="设备编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['productEncoding',{initialValue:this.record.productEncoding}]" id="productEncoding" placeholder="请输入设备编号" disabled></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="警告数量" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input id="riskSurplus" v-decorator="['riskSurplus',{initialValue:this.record.riskSurplus}]" placeholder="请输入警告数量" disabled></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item label="入库数量" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input  placeholder="请输入入库数量" @change="changeNum" id="Num"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24" style="margin-left:-90px;">
            <a-form-item label="设备用途" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-textarea placeholder="请输入出库原因" :auto-size="{ minRows: 3, maxRows: 5 }" @change="changeuse" id="use"/>
            </a-form-item>
          </a-col>
          <a-col :span="24" style="margin-left:-90px;">
            <a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-textarea placeholder="请输入备注" :auto-size="{ minRows: 3, maxRows: 5 }" @change="changeRemark" id="remark"/>
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </j-form-container>
  </a-spin>
</template>

<script>
import { httpAction, getAction } from '@/api/manage'
import pick from 'lodash.pick'
import { validateDuplicateValue } from '@/utils/util'
import JFormContainer from '@/components/jeecg/JFormContainer'
import {getCookie,setCookie} from '@/utils/cookie'

export default {
  name: 'DtApplyMaterielForm',
  components: {
    JFormContainer
  },
   props:['record'], 
  data() {
    return {
     num:'',
     use:'',
     remark:'',
      form: this.$form.createForm(this),
      model: {},
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 }
      },
      confirmLoading: false,
      validatorRules: {},
      url: {
        add: '/dtapplymateriel/dtApplyMateriel/add',
        edit: '/dtapplymateriel/dtApplyMateriel/edit',
        queryById: '/dtapplymateriel/dtApplyMateriel/queryById',
        scanA:'/dt_product_put_in_storage/dtProductPutInStorage/scanA'
      }
    }
  },
  computed: {
    formDisabled() {
      if (this.formBpm === true) {
        if (this.formData.disabled === false) {
          return false
        }
        return true
      }
      return this.disabled
    },
    showFlowSubmitButton() {
      if (this.formBpm === true) {
        if (this.formData.disabled === false) {
          return true
        }
      }
      return false
    }
  },
  created() {
   
  },
  mounted() {
      console.log('record22',this.record)
  },
  methods: {
    changeNum(value){
      console.log('123456',document.querySelector('#Num').value)
      this.num = document.querySelector('#Num').value
    },
    changeuse(){
      this.use = document.querySelector('#use').value
    },
     changeRemark(){
      this.remark = document.querySelector('#remark').value
    },

   
    
  }
}
</script>